home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr47
/
asmlib40.zip
/
SOURCE.DOC
< prev
next >
Wrap
Text File
|
1995-03-30
|
36KB
|
943 lines
SOURCE.DOC Copyright (C) 1992 - 1995 Douglas Herr ■ all rights reserved
RE-ASSEMBLING or MODIFYING ASMLIB LIBRARIES
Several INCLUDE files are in the ASMLIB source code archive which are
used to define the code and data segments for the various memory models.
For each memory model, you will need MODEL.INC to define the library
segments, and a corresponding ASM.INC for the simplified segment definitions
for your your main proegram. There are several versions of MODEL.INC and
ASM.INC in the ASMLIB source archive. To use a particular memory model,
for example the medium memory model, you should copy ASMM.INC to ASM.INC
and copy MEDIUM.INC to MODEL.INC:
LIBRARY MEMORY MODEL LIBRARY INCLUDE FILE MAIN PROGRAM INCLUDE FILE
copy to MODEL.INC copy to ASM.INC
TINY TINY.INC ASMT.INC
asm86t.lib
asm286t.lib
evga86t.lib
evga286t.lib
SMALL SMALL.INC ASMS.INC
asm86s.lib
asm286s.lib
evga86s.lib
evga286s.lib
MEDIUM MEDIUM.INC ASMM.INC
asm86m.lib
asm286m.lib
evga86m.lib
evga286m.lib
HUGE HUGE.INC ASMH.INC
asm86h.inc
asm286h.inc
evga86h.inc
evga286h.inc
In general the properties of the memory models are:
TINY
Code, data and stack are all in the same segment; the total size
of the segment may not exceed 64k. All references to initialized data
are near, all subroutine calls are near. The program may use dynamic memory
allocation and/or EMS or XMS memory for additional data space. TINY model
programs are linked with ASMLIB's TINY.ASM startup code and produce
.COM-format programs.
To use the TINY memory mode, copy ASMT.INC to ASM.INC for your main program
source code, and copy TINY.INC to MODEL.INC if you need to modify library
source code. LINK or TLINK using the /T switch; the TINY.OBJ object module
must be the first object module linked.
ASMLIB libraries for the TINY model are:
asm86t.lib general-purpose library, for 8088 or better computers
asm286t.lib general-purpose library, for 286 or better computers
evga86t.lib graphics library for 8088 or better computers, replaces
ASMTINY graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
evga286t.lib graphics library for 286 or better computers, replaces
286TINY graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
SMALL
Code is in a single segment, which may not exceed 64k. Initialized data
and the stack are in a separate segment, which may not exceed 64k. As
with the TINY model, the program may use dynamic memory allocation and/or
EMS or XMS memory for additional data space. The small model assumes near
subroutine calls.
To use the SMALL memory model, copy ASMS.INC to ASM.INC for your main program
source code, and copy SMALL.INC to MODEL.INC for modifying library object
modules. SMALL model programs are linked with ASMLIB's STARTUP startup
code; STARTUP.ASM is assembled after ASMS.INC is copied to ASM.INC.
ASMLIB libraries for the SMALL model are:
asm86s.lib general-purpose library, for 8088 or better computers
asm286s.lib general-purpose library, for 286 or better computers
evga86s.lib graphics library for 8088 or better computers, replaces
ASMSMALL graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
evga286s.lib graphics library for 286 or better computers, replaces
286SMALL graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
MEDIUM
Code may be in more than one segment, each of which may not exceed 64k.
Initialized data and the stack are in a separate segment, which may not
exceed 64k. As with the TINY and SMALL models, the program may use dynamic
memory allocation and/or EMS or XMS memory for additional data space. The
medium model assumes far subroutine calls between code segments.
To use the MEDIUM memory model, copy ASMM.INC to ASM.INC for your main program
source code and for STARTUP.ASM, and copy MEDIUM.INC to MODEL.INC for
modifying library object modules. MEDIUM model programs are linked with
ASMLIB's STARTUP startup code; STARTUP.ASM is assembled after ASMM.INC is
copied to ASM.INC.
ASMLIB libraries for the MEDIUM model are:
asm86m.lib general-purpose library, for 8088 or better computers
asm286m.lib general-purpose library, for 286 or better computers
evga86m.lib graphics library for 8088 or better computers, replaces
ASMLIB graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
evga286m.lib graphics library for 286 or better computers, replaces
286LIB graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
HUGE
ASMLIB's definition of a HUGE memory model does not strictly adhere
to the standard definition, which says that the program should not assume
that DS is pointed to any particular data segment. ASMLIB's HUGE model
libraries assume DS:DGROUP, SS:DGROUP. Code may be in more than one
segment, each of which may not exceed 64k. Initialized data and the stack
are in a separate segment, which may not exceed 64k. Dynamic memory
allocation, EMS or XMS memory and additional data segments may be used for
additional data space. The huge model assumes far subroutine calls between
code segments. The primary difference between ASMLIB's MEDIUM and HUGE
model libraries is that the HUGE model libraries allow seamless access to
data blocks greater than 64k. Data blocks over 64k bytes are typically
dynamically allocated to store large bit blocks from high-resolution
graphics screens or may be loaded from a disk file.
To use the HUGE memory model, copy ASMH.INC to ASM.INC for your main program
source code and for STARTUP.ASM, and copy HUGE.INC to MODEL.INC for
modifying library object modules. HUGE model programs are linked with
ASMLIB's STARTUP startup code; STARTUP.ASM is assembled after ASMH.INC is
copied to ASM.INC.
ASMLIB libraries for the HUGE model are:
asm86h.lib general-purpose library, for 8088 or better computers
asm286h.lib general-purpose library, for 286 or better computers
evga86h.lib graphics library for 8088 or better computers, replaces
ASMHUGE graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
evga286h.lib graphics library for 286 or better computers, replaces
286HUGE graphics subroutines with subroutines for EGA
or VGA 16-color graphics only. Eliminates much of the
code and data required for Hercules, CGA, 256-color and
SVGA modes.
You should use the "smallest" memory model your program allows; if your
program's code + initialized data is less than 64k, you will probably get
the smallest and fastest program using the TINY model. If your program
requires more code or data space than the TINY model allows, use the SMALL
model. The MEDIUM model works well for programs with code > 64k, but
should be avoided for smaller programs because the FAR calls used between
code segments are slower and consume more bytes than the NEAR calls in
the SMALL and TINY models. The HUGE model should be used only where you
need to use continuous data blocks greater than 64k, because the code
required to span 64k segment boundaries adds extra bytes to the program
and slows its operation somewhat.
The EGA/VGA 16-color graphics libraries (EVGA*.LIB) are used in
conjunction with the general purpose libraies. The EGA/VGA libraries
contain subroutines which replace the general-purpose graphics mode
subroutines in the general-purpose libraries, but do not include the
full ASMLIB library.
To make LINK or TLINK use the EGA/VGA-specific subroutines, link your
program specifying the EVGA library before the general-purpose library.
This example links ASMLIB's tiny.obj startup code with your program.obj
object module, using EGA or VGA 16-color graphics only, and a 286 or
better computer:
LINK /T tiny+program,program,,evga286t+asm286t;
To assemble library source code for 286 or better computers, use the
MASM/TASM /D switch, which allows you to define assembly conditions.
This example assembles DRAWLINE.ASM for 286 or better computers:
MASM /DNOXT drawline;
You may use multiple /D switches when assembling ASMLIB source code.
This example assembles GPRINT.ASM for 286 or better computers using
EGA or VGA 16-color graphics only:
MASM /DNOXT /DEVGA gprint;
You can replace an object module in any of the ASMLIB libraries using
MASM's LIB or TASM's TLIB utility program. Let's say I've modified
GPRINT.ASM and I want to update the ASM86M.LIB library with the new
GPRINT object module:
MASM gprint;
LIB ASM86M -+gprint;
ASMLIB includes a number of subroutines which are not applicable to general
programming. These subroutines include "$" in their names. All "$"
subroutines require a near call, so the calling program must be in the same
segment as the called subroutine. The segment names used by ASMLIB are:
tiny: _TEXT (assumes CS:DGROUP, DS:DGROUP)
small: _TEXT (assumes CS:_TEXT, DS:DGROUP)
medium: _MEDIUM (assumes CS:_MEDIUM, DS:DGROUP)
huge: _HUGE (assumes CS:_HUGE, DS:DGROUP)
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$banks.asm: SVGA bank-switching code
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$clip: clip a line to fit within graphics view area
Source: $clip.asm ($graph.asm)
Call with: call from ASMLIB line drawing subroutines
assumes DS:@data
Returns: x & y coordinates in DRAWLINE data area within view area
Uses: AX, BX, CX, DX, DI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$circle: calculates circle aspect ratio and circumferance
Source: $circle ($graph.asm)
Used by: DrawCircle; don't try using this subroutine without
in-depth knowledge of $circle and DrawCircle
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$ega16: update EGA/VGA/SVGA registers for given drawmode & color
Source: $ega16.asm ($graph.asm)
Call with: no parameters
call $graph before calling $ega16
drawmode & gcolor must be current
Returns: DX = 3CEh (Graphics Controller data register address)
Uses: DX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$emspage: position logical EMS page at page 0 of page frame
source: $emspage.asm
Call with: DS:[BX] pointing to 4-byte offset into allocated EMS block
DX = EMS handle
Returns: if CF = 0, no error; AL = logical page
if CF = 1, AH = error code
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$enter: entry code for ASMLIB graphics subroutines which saves
registers and sets up ASMLIB for the graphics mode in use
Source: $enter.asm ($graph.asm)
Call with: no parameters
Returns: calls $graph
pushes flags, BX, CX, DX, DI, SI, ES, BP
BP = SP
DF = 0
Uses: AX, SP, DF
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$exit: exit code for ASMLIB graphics subroutines
Source: $exit.asm
Call with: BP = stack frame pointer
AX, flags, BX, CX, DX, DI, SI, ES, BP pushed on stack
Returns: returns to program calling the primary subroutine
Uses: flags, all registers except DS
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$fget: read more data into file buffer; used by ASMLIB buffered file
input subroutines
Source: $fget.asm
Call with: BX = file handle
ES = buffer segment address
Returns: DF = 0
if CF = 0, AX = bytes read from file
if CF = 1, AX = DOS error code
Uses: AX, DX, SI, DS, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gbytes: calculate byte size of graphics screen
Source: $gbytes.asm ($graph.asm)
Call with: no parameters
$graph must have been called while in the current
graphics mode before calling $gbytes
Returns: DX:AX = byte size of screen
Uses: AX, DX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$getdot: determines pixel status (graphics modes)
Source: $getdot.asm ($graph.asm)
Call with: AX = x-coordinate, BX = y-coordinate
ES = segment address of screen buffer
$graph must have been called while in the current
graphics mode before calling $getdot
Returns: AX = pixel value
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gp00, $gp02, $gp06, $gp08, $gp10: GPrint/GPrintX code for various dottypes
Source: $gp00.asm, $gp02.asm, $gp06.asm $gp08.asm, $gp10.asm
(banks.asm, $ytable.asm)
Call with: called from GPrint or GPrintX subroutines
DS:[SI] -> character font definition
ES = segment address of screen buffer
Returns: nothing
prints a character on graphics screen
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$gpick: select string from fixed-field string block; graph mode
Source: $gpick.asm (heap.asm, strncpy.asm, drawbox.asm, fillbox.asm,
gprint.asm, allocdos.asm, bitblock.asm, bbbytes.asm,
strlen.asm, gcolor.asm, a$menu.asm, $graph.asm, m$input.asm,
v$extkey.asm, m$chrn.asm, m$nkey.asm)
Call with: ES = segment address of string list
AX = number of strings
CX = field size
BX = initial choice
DS:[DX] pointing to upper left screen coordinates
assumes DS:DGROUP
Returns: AX = returning keycode
BX = returned selection number
Uses: AX, BX, CX, DX, SI, DI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$graph: set up screen parameters for all ASMLIB graphics modes
Source: $graph.asm (gcolor.asm, $ytable.asm)
Call with: no parameters
system must be in graphics mode you intend to use
Returns: nothing
updates $graph data: view coordinates
x-limit
y-limit
base segment address
page size
byte width of screen
maximum page number
dot type: 0 = CGA 4-color
2 = monochrome
(CGA, Herc, ATT, mode 11h)
4 = Hercules InColor
6 = EGA/VGA 16-color & monochrome
SVGA16 (up to 800x600)
8 = mode 13h 256-color
10 = VGA13X
12 = SVGA16 (over 800x600)
14 = SVGA256
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$h8x8: copies standard 8x8 character definition to 0B400:0000
for Hercules RamFont modes
Source: $h8x8.asm (f8x8.asm)
Call with: no parameters; assumes Hercules RamFont card is installed
Returns: nothing
Uses: nothing; all registers and flags are saved
Used by: HRam9043, HRam8043
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$h8x12: copies standard 8x12 character definition to 0B400:0000
for Hercules RamFont modes
Source: $h8x12.asm ($rld.asm, f8x12rle.asm)
Call with: no parameters; assumes Hercules RamFont card is installed
Returns: nothing
Uses: nothing; all registers and flags are saved
Used by: HRam9029, HRam8029
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$handle: verify handle for buffered file I/O
Source: fopen.asm
Call with: BX = file handle
ASSUMES DS:DGROUP
Returns: if CF = 0, SI points to file handle in ASMLIB buffer data area
segment address of buffer associated with this handle
at 2[SI]
if CF = 1, handle in BX not managed by ASMLIB buffer system
Uses: SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$herc: detects Hercules-compatible equipment; does not determine
if Hercules equipment is the default monitor (see IsHerc)
Source: $herc.asm
Call with: no parameters
Assumes DS:@data
Returns: if CF = 1, no Hercules-compatible equipment installed
if CF = 0, AX = Hercules model
128 = Hercules Graphics Card or compatible
144 = Hercules Graphics Card Plus
208 = Hercules InColor card
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$herc16: update InColor registers for given drawmode & color
used only by dottype 4 in graphics modes
Source: $herc16.asm ($graph.asm)
Call with: no parameters
call $graph before calling $herc16
drawmode & gcolor must be current
Returns: BX = ABS(drawmode) shl 1
Uses: BX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$hislope: draw a high-slope line
Source: $hislope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
$hipatrn.asm, banks.asm, $graph.asm, dotmask.asm)
Call with: DS:@data
ES = screen buffer segment
x0 = [BP-2]
y0 = [BP-4]
x1 = [BP-6]
y1 = [BP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$horiz: draw horizontal line
Source: $horiz.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
banks.asm, $graph.asm, dotmask.asm)
Call with: DS:@data
ES = screen buffer segment
x0 = [BP-2]
y0 = [BP-4]
x1 = [BP-6]
y1 = [BP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$hipatrn: draw a high-slope line with pattern
called from $hislope
Source: $hipatrn.asm
$hpattern: draw a horizontal line with pattern
called from $horiz
Source: $hvpatrn.asm
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$putw: module used by several ASMLIB text subroutines to copy
a character/attribute pair to a window of the screen;
includes snow control logic for CGA systems.
Source: a$putw.asm
Call with: CX = column width of window
DX = 0 to disable snow control
= 3DAh to enable snow control (COLOR monitors only!!)
SI = row height of window
ES:[DI] points to video buffer
AL = character
AH = color attribute
BX = bytes per screen row (80-column screen has 160 bytes per row)
DF = 0 (clear direction flag with CLD)
Uses: DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$paint: used to change color of the screen; used by Paint and
WPaint subroutines. Includes snow control logic for CGA
systems.
Source: $paint.asm
Call with: ES:[DI] pointing to screen
CX = number of columns
SI = number of rows
AH = color attribute
DX = 3DAh for CGA snow control, 0 otherwise
BP = bytes per screen row
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$plane: set up graphics plane for read or write
Source: $plane.asm
Call with: AL = plane number
Returns: nothing
Supports: EGA & VGA 16-color modes
EGA monochrome
VGA13X
Hercules InColor
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$recolor: replaces selected screen color; used by ReColor and
WReColor subroutines. Includes snow control logic for CGA
systems.
Source: $recolor.asm
Call with: ES:[DI] pointing to screen
AL = oldcolor
AH = newcolor
DX = 0 or 3DAh for snow control
SI = number of rows
CX = number of columns
BP = bytes per screen row
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$wdata: parameter manager for ASMLIB's Window subroutines.
Source: a$wdata.asm (crtinfo.asm)
Call with: DS:[BX] pointing to widow corner data
requires 2 bytes available at [bp-2]
row0 equ [bx]
col0 equ 2[bx]
row1 equ 4[bx]
col1 equ 6[bx]
Returns: SI = number of rows
CX = number of columns
DX = 0 if no CGA, 3DAh if CGA and "snow" control not disabled
[bp-2] = bytes per screen row
ES:[DI] -> [row0, col0] on screen
Uses: CX, DX, DI, SI, ES, [BP-2], flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rlbytes: calculates bytes required to decode run-length encoded data
Source: $rlbytes.asm
Call with: DS:[SI] pointing to encoded data
CX = size of encoded data block
Returns: AX = bytes required to decode data block
Uses: AX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rld: decodes run-length encoded data
Source: $rld.asm
Call with: DS:[SI] pointing to encoded source data
ES:[DI] pointing to destination buffer
CX = number of encoded bytes
assumes destination buffer is large enough for decoded data
Returns: nothing
Uses: nothing
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rle: run-length encoding data compression
Source: $rle.asm
Call with: DS:[SI] pointing to data to be encoded
ES:[DI] pointing to output buffer
CX = number of bytes to encode
assumes output buffer is at least the same size as input data
Returns: DF = 0
if CF = 0, AX = encoded data size
if CF = 1, run-length encoding will not compress file
data in output buffer is incomplete
Uses: AX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$strstr: string search module used by several ASMLIB subroutines
Source: $strstr.asm
Call with: ES:[DI] -> search string, DS:[SI] -> pattern string
BX = pattern string length, DX = search string length
$strstr searches for the first occurrance of the pattern
string in the search string
Returns: if CF = 1, no match
if CF = 0, AX = match offset from ES:[DI]
Uses: AX, BX, CX, DX, SI, DI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$wcopy: copies word data from one portion of memory to another;
intended for copying to/from video memory in text mode
includes snow control logic for CGA systems.
Source: $wcopy.asm
Call with: CX = words to copy
DS:[SI] -> source
ES:[DI] -> destination
DX = CRTC status port if CGA, else 0
DF = 0 or 1
Returns: ES:[DI] pointing past end of destination
DS:[SI] pointing past end of block
CX = 0
Uses: AX, CX, DI, SI, flags
Called by: WSave, WRestore, GetScreen, PutScreen, TCopy, VScroll, HScroll
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$strlist: copy group of ASCIIZ strings to block of fixed-length strings
source: $strlist.asm (allocdos.asm, strlen.asm, m$count.asm)
Call with: DS:[SI] pointing to first string to copy
CX = minimum field size
string group terminated with double NUL
requires sufficient free DOS memory
Returns: if CF = 1, insufficient DOS memory available
if CF = 0:
ES = base segment address of string block
AX = number of strings
CX = string field size
Uses: AX, CX, ES, flags
Called by: PICKSTR, GPICKSTR
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$count: counts a group of ASCIIZ strings
Source: m$count.asm (strlen.asm)
Call with: DS:[BX] pointing to first string
string group terminated with double NUL
Returns: AX = number of strings
CX = length of longest string in group
Uses: AX, BX, CX, flags
Called by: PICKSTR, PULLDOWN
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$nkey: process normal keystroke for menu subroutines
Source: m$nkey.asm (isupper.asm, m$chr.asm)
Call with: AL = key code
BX = initial cursor position
CX = field width
DX = number of menu choices
ES:[DI] pointing to first menu choice
Returns: BX = output position
if CF = 0, found matching character
if CF = 1, no match
Uses: AX, BX, CX, DX, DI, flags
Called by: $pick
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$chr: determines if a keycode is the first uppercase character
in a string
Source: m$chr.asm (strlen.asm)
Call with: AX = keycode
DS:[BX] pointing to string
Returns: if CF = 1, string length = 0
if CF = 0:
CX = 0 if no upper case characters in the string
if CX <> 0, AH = first UCASE character
ZF = 1 if character is first ucase in string
DS:[BX] points to first ucase character
Uses: AX, BX, CX, flags
Called by: $pick, PULLDOWN
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$listwindow: calculates window dimensions for input list; adjusts
upper left corner coordinates if required to fit on screen
Source: $pick.asm (crtinfo.asm)
Call with: DS:[BX] pointing to 8-byte data area for window corner data
AX = number of choices in list
CX = list field width
DH = desired first screen row for list
DL = desired first column for list
$listwindow assumes that DH < total screen rows
Returns: DH = adjusted first row for $pick
DL = adjusted first column for $pick
8 bytes at DS:[BX] are updated with window corner coordinates
for WSave, WFrame, WRestore, etc.
Uses: DX; all other registers and flags are saved
Called by: PICKSTR, PICKFILE
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$pick: select one string from a list of fixed-length strings
used in text-mode menu subroutines
Source: $pick.asm (crtinfo.asm, str2vbuf.asm, a$putw.asm, m$input.asm,
m$chr.asm, m$nkey.asm, a$menu.asm, v$extkey.asm)
Call with: ES:[DI] pointing to list of choices
AX = number of menu choices
CX = field width
BX = initial cursor position
DH = top screen row
DL = left screen column
Returns to calling program when Esc, Enter or ^C pressed
Returns: if BreakTrap enabled:
if CF = 1, ^C or ^Break was pressed
AX = last key pressed (AX = 3 if ^C pressed)
BX = string number selected (first string = 0)
Uses: AX, BX, CF
Called by: PICKSTR, PICKF
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
v$extkey: extended keycode processor for ASMLIB vertical list menus
(text and graph modes)
Source: v$extkey.asm
Call with: AL = low word of ASMLIB extended key code
[bp-2] = field width of string list
[bp-4] = number of choices
[bp-6] = current choice
[bp-8] = first string to print (for scrolling if required)
[bp-10] = number of strings to print
( = number of choices if no scrolling required)
Returns: if CF = 0, modifies [bp-6] and [bp-8]
if CF = 1, keycode not a valid cursor movement key
valid keys: Up, Down, Home, End, PgUp, PgDown
Uses: AX, flags
Called by: $pick, $gpick
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
FIND_CGA: determine if color monitor is installed
FIND_MDA: determine if monochrome monitor is installed
Source: $6845.asm
Call with: no parameters
Returns: if CF = 0, monitor is installed
if CF = 1, monitor is not installed
Uses: flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$ytable: calculate buffer offset for each row of screen
used to set up for dottype 0 - 4 graphics modes
Source: $ytable.asm ($herc.asm)
Call with: AX = 0
ES:[DI] pointing to YTABLE data area
CX = ylimit+1
DF = 0
Returns: nothing
Uses: AX, BX, CX, DX, DI
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
a$mname: return month or day name to calling program
used by MONTHNAME and DAYNAME
Source: a$mname.asm
Returns: ES:[BX] -> month name string
CX = string length
Uses: ES, BX, CX
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$vga256: determine color & machine code for given drawmode
Source: $vga256.asm ($graph.asm)
Call with: no parameters
call $graph before calling $vga256
drawmode & gcolor must be current
Returns: AL = color
DL = machine code
DH = ABS(drawmode)
Uses: AX, DX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$reset: restores default hardware settings for graphics modes
used as part of exit code from ASMLIB graphics subroutines
Source: $reset.asm ($graph.asm)
Call with: no parameters
Returns: nothing
Uses: nothing
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$putdot: updates a pixel on graphics screen
Source: $putdot.asm ($graph.asm, $herc16.asm, banks.asm, dotmask.asm)
Call with: AX = x-coordinate, BX = y-coordinate
ES = segment address of screen buffer
all $graph data must be current
Returns: nothing
Uses: flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$rotate: rotates character font for GPrint & GPrintX
Source: $gp.asm
Call with: DS:[SI] pointing to unrotated font
Returns: DS:[SI] pointing to new charcter font on stack
DS:@data
Uses: DS, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$vert: draw vertical line
Source: $vert.asm ($ega16.asm, $herc16.asm, $vga256.asm, $hvpatrn.asm
banks.asm, $graph.asm, dotmask.asm)
Call with: DS:@data
ES = screen buffer segment
x0 = [BP-2]
y0 = [BP-4]
x1 = [BP-6]
y1 = [BP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$loslope: draw a low-slope line
Source: $loslope.asm ($ega16.asm, $herc16.asm, $vga256.asm,
$lopatrn.asm, banks.asm, $graph.asm, dotmask.asm)
Call with: DS:@data
ES = screen buffer segment
x0 = [BP-2]
y0 = [BP-4]
x1 = [BP-6]
y1 = [BP-8]
Returns: nothing
Uses: AX, BX, CX, DX, DI, SI, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
m$input: input module for ASMLIB menu subroutines
Source: m$input.asm (kifwait.asm, $flags.asm)
Call with: DS:@data
Returns: AX = keycode
BX = mouse buttons pressed
mouse motion is returned as a Left, Right, Up or Down
keycode. IsMouse must be called before the menu subroutine
to enable mouse functions.
Uses: AX, BX, flags
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
$lopatrn: draw a low-slope line with pattern
called from $loslope
Source: $lopatrn.asm
$vpattern: draw a vertical line with pattern
called from $vert
Source: $hvpatrn.asm